package com.nbsaas.boot.finance.data.entity;

import com.nbsaas.boot.code.annotation.*;
import com.nbsaas.boot.jpa.data.entity.AbstractEntity;
import jakarta.persistence.*;
import lombok.Data;
import org.hibernate.annotations.Comment;

import java.math.BigDecimal;

@CreateByUser
@ComposeView
@Data
@FormAnnotation(title = "凭证明细", model = "凭证明细")
@Entity
@Table(name = "bs_voucher_entry")
@Comment("凭证明细表")
public class VoucherEntry extends AbstractEntity {

    @ManyToOne
    @JoinColumn(name = "voucher_id")
    private Voucher voucher;

    @Comment("会计科目ID")
    @FormField(title = "会计科目ID", sortNum = "1", grid = true, required = true)
    private Long subjectId;

    @Comment("会计科目名称")
    @FormField(title = "会计科目名称", sortNum = "2", grid = true)
    private String subjectName;

    @Comment("借方金额")
    @FormField(title = "借方金额", sortNum = "3", grid = true, type = InputType.el_input_number)
    private BigDecimal debitAmount;

    @Comment("贷方金额")
    @FormField(title = "贷方金额", sortNum = "4", grid = true, type = InputType.el_input_number)
    private BigDecimal creditAmount;

    @Comment("摘要")
    @FormField(title = "摘要", sortNum = "5", grid = true)
    private String summary;
} 